#define _CRT_SECURE_NO_WARNINGS
#include"list.h"
namespace carrot
{
	void testList1()
	{
		list<int> lt;
		lt.push_back(1);
		lt.push_back(2);
		lt.push_back(3);
		lt.push_back(4);
		lt.push_back(5);
		for (auto e : lt)
		{
			cout << e << " ";
		}
		cout << endl;
		list<int>::iterator it = lt.begin();
		it=lt.insert(it, 10);
		for (auto e : lt)
		{
			cout << e << " ";
		}
		cout << endl;
		//list<int>::iterator it1 = lt.begin();
		cout << lt.size() << endl;
		lt.erase(it);
		for (auto e : lt)
		{
			cout << e << " ";
		}
		cout << endl;
		cout << lt.size() << endl;

		/*lt.push_front(10);
		for (auto e : lt)
		{
			cout << e << " ";
		}
		cout << endl;
		lt.pop_front();
		for (auto e : lt)
		{
			cout << e << " ";
		}
		cout << endl;*/
	}
	void testList2()
	{
		list<int> lt({ 1,2,3,4,5,6 });
		for (auto e : lt)
		{
			cout << e << " ";
		}
		cout << endl;
		list<int> lt2(10, 1);
		for (auto e : lt2)
		{
			cout << e << " ";
		}
		cout << endl;
		list<int> lt3(lt);
		for (auto e : lt3)
		{
			cout << e << " ";
		}
		cout << endl;
		lt2 = lt;
		for (auto e : lt2)
		{
			cout << e << " ";
		}
		cout << endl;
	}
}
int main()
{
	carrot::testList2();
	return 0;
}